﻿{% extends 'base.html' %}
{% block title %}图片详情{% endblock %}
{% block css %}detail{% endblock %}
{% block user_url %}
    {% if current_user.is_authenticated %}
        /profile/{{current_user.id}}
    {% else %}
        /reglogin/
    {% endif %}
{% endblock %}
{% block page_main %}
<div class="page-main clearfix">
    <article>
        <div class="pic-wrapper">
            <img src="{{ image.url }}">
        </div>
        <div class="pic-discuss">
            <header class="discuss-hd">
                <a href="/profile/{{ image.user_id }}" class="avatar">
                    <img src="{{ image.user.head_url }}">
                </a>
                <div class="profile-info">
                    <a title="{{ image.user.username }}" href="/profile/{{ image.user.id }}/">{{ image.user.username }}</a>
                </div>
            </header>
            <section class="like-item">
                <time class="discuss-time" datetime="2016-05-07T02:21:41.000Z" title="2016年5月7日" data-reactid=".0.1.0.0.0.2.0.1.0">{{ image.created_date }}</time>

                <div class="like-names">
                    <a class="_4zhc5 _lx2l2" title="redmadqueen" href="/redmadqueen/">redmn</a>
                    <span data-reactid=".0.1.0.0.0.2.0.0.a"> 赞了</span>
                </div>

            </section>
            <ul class="discuss-list">
                <!--
                <li>
                    <h1>
                        <a>toutvadisparaitre</a>
                        <span data-reactid=".0.1.0.0.0.2.1.0.0.1">
                            <span data-reactid=".0.1.0.0.0.2.1.0.0.1.0">和朋友吐一吐是解忧最佳</span>
                        </span>
                    </h1>
                </li>
                -->
                {% for comment in image.comments %}
                <li>
                    <a href="/profile/{{ comment.user_id }}/">{{ comment.user.username }}</a>
                    <span>
                        <span>{{ comment.content }}</span>
                    </span>
                </li>
                {% endfor%}
            </ul>
            <section class="discuss-edit" >
                <a class="icon-heart-empty"></a>
                <form method="post"  id="comment-form">
                    <input id="comment-content" placeholder="添加评论..." type="text">
                    <input id="image-id" hidden value="{{ image.id }}">
                    <button onclick="comment();" value="评论">
                </form>
                <!--<button class="more-info">更多选项</button>-->
            </section>
        </div>
    </article>
</div>
{% endblock %}

{% block js %}
<script type="text/javascript">
    window.uid = {{current_user.id}};
</script>
<!--<script type="text/javascript" src="/static/js/jquery.js"></script>-->
<script type="text/javascript" src="/static/js/pageDetail.js"></script>
{% endblock%}